Component({
  properties: {
    currentYear: {
      type: Number,
      value: 0
    },
    currentMonth: {
      type: Number,
      value: 0
    },
    days: {
      type: Array,
      value: []
    },
    emptyDays: {
      type: Array,
      value: []
    },
    weekdays: {
      type: Array,
      value: ['日', '一', '二', '三', '四', '五', '六']
    },
    selectedDay: {
      type: Number,
      value: 0
    },
    today: {
      type: Object,
      value: {
        year: 0,
        month: 0,
        day: 0
      }
    },
    prevIcon: {
      type: String,
      value: '/assets/images/箭头左.png'
    },
    nextIcon: {
      type: String,
      value: '/assets/images/箭头左.png'
    }
  },

  data: {},

  methods: {
    onSelectDay(e) {
      const selectedDay = e.currentTarget.dataset.day;
      this.triggerEvent('dayselect', { day: selectedDay });
    },

    onPrevMonth() {
      this.triggerEvent('prevmonth');
    },

    onNextMonth() {
      this.triggerEvent('nextmonth');
    }
  }
});